package states 
{
	import org.flixel.*;
	import entities.*;
	
	public class PlayState extends FlxState 
	{
		[Embed(source = "../../art/Background.png")] private var gfxBackground:Class;
		
		private var discArray:Array;
		public static var player:Player;
		
		private var currentDisc:Number = 0;
		
		private var txtEntech:FlxText;
		
		public function PlayState() 
		{
			super();
			
			var background:FlxSprite = new FlxSprite(0, 0, gfxBackground);
			add(background);
			
			//FlxG.debug = true;
			//FlxG.showBounds = true;
			
			if (!player) {
				player = new Player();
				player.height = 8;
				player.offset.y = 16;
			}
			
			discArray = new Array();
			for (var i:int = 0; i < 30; i++) {
				var disc:Disc = new Disc();
				add(disc);
				discArray.push(disc);
			}
			var xLoc:Number = 20;
			for (i = 0; i <= 12; i++) {
				discArray[i].y = FlxG.height - 75;
				discArray[i].x = xLoc;
				xLoc += 16;
				PlayState.player.currentDisc++;
			}
			player.discArray = discArray;
			
			add(player);
			
			txtEntech = new FlxText(60, FlxG.height - 16, 400, "Brought to you by: Entech 281");
			txtEntech.setFormat(null, 10, 0xFFFFFFFF, "left");
			add(txtEntech);
		}
		override public function update():void {
			super.update();
		}
	}
}